<?php $this->load->view('common/admin_header');?>
<div class="block">
  <div class="block_head">
    <div class="bheadl"></div>
    <div class="bheadr"></div>
    <h2><?=$lang['content_lable_3']?></h2>
  </div>
  <!-- .block_head ends -->
  <div class="block_content">
    <p class="breadcrumb"><?=$lang['global_lable_14']?> &raquo; <a href="<?=site_url('admins/index')?>"><?=$lang['global_lable_11']?></a> &raquo; <?=$lang['content_lable_1']?> &raquo; <strong><?=$lang['content_lable_3']?></strong></p>
    <?php $this->load->view('common/notify');?>
    <form action="<?=site_url('admins/categorys')?>" method="get">
      <input type="hidden" name="field" value="<?=isset($field)?$field:'n.sort_order'?>" id="field">
      <input type="hidden" name="sort" value="<?=isset($sort)?$sort:'asc'?>" id="sort">
      <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
        <thead>
          <tr>
            <!-- <th>封面圖</th> -->
            <th><a id="nd.title" class="<?=isset($field) && $field=='nd.title'?$sort:'';?>" href="#"><?=$lang['global_lable_15']?></a></th>
            <!-- <th><a id="n.unique_url" class="<?=isset($field) && $field=='n.unique_url'?$sort:'';?>" href="#">靜態網址</a></th> -->
            <th><a id="n.status" class="<?=isset($field) && $field=='n.status'?$sort:'';?>" href="#"><?=$lang['global_lable_16']?></a></th>
            <th><a id="n.sort_order" class="<?=isset($field) && $field=='n.sort_order'?$sort:'';?>" href="#"><?=$lang['global_lable_17']?></a></th>
            <!-- <th><a id="n.is_menu" class="<?=isset($field) && $field=='n.is_menu'?$sort:'';?>" href="#">是否菜單</a></th> -->
            <th style="text-align:center"><?=lang('cart_action')?></th>
          </tr>
          <tr>
            <!-- <td>&nbsp;</td> -->
            <td><input type="text" class="stext" name="title" lang="zh-TW" x-webkit-speech x-webkit-grammar="bUIltin:search" value="<?=isset($title)?$title:''?>"></td>
            <!-- <td><input type="text" class="stext" name="unique_url" lang="zh-TW" x-webkit-speech x-webkit-grammar="bUIltin:search" value="<?=isset($unique_url)?$unique_url:''?>"></td> -->
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <!-- <td>&nbsp;</td> -->
            <td style="text-align:center">
              <input type="submit" class="btn btn-small btn-primary" name="sub_filter" value="<?=$lang['global_lable_22']?>"/>
              <a href="<?=site_url('admins/categorys/add')?>" class="btn btn-small btn-danger"><i class="icon-plus"></i> <?=$lang['global_lable_23']?></a>
            </td>
          </tr>
        </thead>
        <tbody class="table">
        <?php if(isset($lists_count) && $lists_count>0):?>
        <?php foreach($lists as $list):
            $urls=site_url('admins/categorys/%s/'.$list['id']);
            // $thumb_img=!empty($list['main_image']) && file_exists($list['main_image'])?Imagelib::resize_thumb($list['main_image'],80,80):'themes/admins/img/noimage.png';
            $status=$list['status']==1?$lang['global_lable_37']:'<span style="color:red"><?=$lang["global_lable_37"]?></span>';
        ?>
          <tr>
            <td title="<?=$list['title']?>">
              <?=mb_substr($list['title'],0,100,'utf-8')?>
              <?php if(mb_strlen($list['title'])>100) echo '...';?>
            </td>
            <!-- <td><?=$list['unique_url']?></td> -->
            <td><?=$status?></td>
            <td><?=$list['sort_order']?></td>
            <!-- <td><?=$list['is_menu']==1?'是':'否'?></td> -->
            <td class="listaction">
              <a href="<?=sprintf($urls,"edit");?>" class="l_edit"><?=$lang["global_lable_24"]?></a>
              <a href="javascript:void(0);" onClick="delete_item('<?=sprintf($urls,"delete")?>');" class="l_delete"><?=$lang["global_lable_25"]?></a>
            </td>
          </tr>
         <?php endforeach;?>
         <?php else:?>
         <tr>
             <td colspan="9" class="nodata"><p><?=$lang["global_lable_42"]?></p></td>
         </tr>
         <?php endif;?>
        </tbody>
      </table>
      <!-- .tableactions ends -->
      <div id="pagination"><?php echo $pagination;?><div class="listscount"><?=$lang["global_lable_29"]?> <?=$lists_count?> <?=$lang["global_lable_30"]?></div></div>
    </form>
  </div>
  <!-- .block_content ends -->
  <div class="bendl"></div>
  <div class="bendr"></div>
</div>
<?php $this->load->view('common/admin_footer');?>